<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/common/page.jsp" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<%@include file="/common/head.jsp" %> 
<title>新增文章 - 资讯管理 - H-ui.admin v3.0</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" action="${rootPath }/back/articleSubmit-${type }.html" enctype="multipart/form-data" method="post">
		<c:if test="${type=='edit' }">
			<input type="hidden" value="${brief.id }" name="id" />
			<input type="hidden" value="${brief.readNum }" name="readNum" />
			<input type="hidden" value="${brief.publishTime }" name='publishTime' />
			<input type="hidden" value="${brief.img }" name="dbImg" />
			
		</c:if>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${brief.title }" placeholder="请在此输入文章标题,正文不需要再次输入" required name="title">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章类型：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select name="categoryID" class="select">
					<c:forEach items="${categorys }" var="category">
						<option value="${category.categoryID }" ${category.categoryID==brief.articleCategory.categoryID?'selected':'' }>${category.categoryName }</option>
					</c:forEach>
				</select>
				</span>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关键词：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${detail.keywords }" placeholder="多个关键词用”,“分割" required name="keywords">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章摘要：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="summary" required class="textarea"  placeholder="写点什么...最少输入20个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" >${brief.summary }</textarea>
				<!-- <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p> -->
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章作者：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${detail.author }" placeholder="留空默认为自己的用户名" id="" name="author">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章来源：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${detail.source }" placeholder="默认为”悦来“" id="" name="source">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">允许评论：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="check-box">
					<input type="checkbox" ${detail.allowComments==1?'checked':'' } name="allowComments" value="1">
					<label for="checkbox-pinglun">&nbsp;</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">直接发布：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="check-box">
					<input type="checkbox" checked name="status" value="1">
					<label for="checkbox-pinglun">&nbsp;</label>
				</div>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>缩略图：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="uploader-thum-container">
					<input type="file" name="image"/>
					<img alt="" src="${brief.img }">
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章内容：</label>
			<div class="formControls col-xs-8 col-sm-9"> 
				<script id="editor" type="text/plain" style="width:100%;height:400px;" name="detail">${detail.detail}</script> 
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="parent.layer.close(parent.layer.index);" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${rootPath }/static/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${rootPath }/static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="${rootPath }/static/h-ui.admin/js/H-ui.admin.page.js"></script> 
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="${rootPath }/static/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>   
<script type="text/javascript" src="${rootPath }/static/lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="${rootPath }/static/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="${rootPath }/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

console.log(window.parent.location.href)
console.log(top.location.href)
var ue = UE.getEditor('editor');
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>